package com.link2room.soundwave.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * @author sqj88
 * @date 2018/1/8 21:19
 */
@Entity
@Table(name = "pms_task_base")
@DynamicInsert
public class PmsTaskBase extends BaseEntity{
    private String taskType;
    private Date lastUpdatetime;

    @Basic
    @Column(name = "task_type", nullable = false, length = 20)
    public String getTaskType() {
        return taskType;
    }

    public void setTaskType(String taskType) {
        this.taskType = taskType;
    }

    @Basic
    @Column(name = "last_updatetime", nullable = false)
    public Date getLastUpdatetime() {
        return lastUpdatetime;
    }

    public void setLastUpdatetime(Date lastUpdatetime) {
        this.lastUpdatetime = lastUpdatetime;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        PmsTaskBase that = (PmsTaskBase) o;

        if (taskType != null ? !taskType.equals(that.taskType) : that.taskType != null) return false;
        return lastUpdatetime != null ? lastUpdatetime.equals(that.lastUpdatetime) : that.lastUpdatetime == null;
    }

    @Override
    public int hashCode() {
        int result = taskType != null ? taskType.hashCode() : 0;
        result = 31 * result + (lastUpdatetime != null ? lastUpdatetime.hashCode() : 0);
        return result;
    }
}
